import React, { Component } from 'react'
import  Taro  from '@tarojs/taro'
import { View, Text, Image   } from '@tarojs/components'
import './index.scss'
import titleImg from '../../../assetsImg/images/海报1.jpg'

import Line from '../../comment/upLine' 

function MyTitleImg({imgMsg}){
  return(
    <View className='above'>
      <Image src={imgMsg.src} />
      <Text>{imgMsg.title}</Text>
    </View>
  )
}
const textMsg = ['完善信息','我的活动','我的待看书籍']
// 完善信息，我的活动，我的待看书籍
const texturl = [ '/pages/otherPages/my-items/my-detailed/index',
    '/pages/otherPages/my-items/my-active/index',
    '/pages/otherPages/my-items/my-book/index',
  ]

export default class Index extends Component {

  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }
  
  handleClick=()=>{
    console.log(111111111)
  }
  clickMyItem = (e)=>{
    console.log(e)
    Taro.navigateTo({
      url: texturl[e],
    });
  }

  render () {
    return (
      <View className='index'>
        <Line />
        <MyTitleImg imgMsg={{src:titleImg,title:'平生不修善果,只爱杀人放火'}} />
        <View>
          <Line mb='0' />
          {textMsg.map((v,i)=>{
            return (<View key={i+v} onClick={() =>this.clickMyItem(i)}>
              <View className='my-item'>{v}</View>
              <Line mb='0' />
            </View>
            )
          })}
        </View>
      </View>
    )
  }
}
